/**********************************************
 * 	Adverb.java								  *
 *  Course: CS3343							  *
 *  Version: 2.0     Release 1				  *
 *  Last Modified : 22 MAR 2013			      *
 **********************************************/
package checker;

public class Adverb extends Word {

	public Adverb(String sign){
		super(sign,"Adverb");
	}

	public Adverb() {
		super("[adv]","Noun");
	}

	public boolean isOfType(String word) {
		// get all the words starting with the letter same as the initial letter of the input word
		// the second argument is the type of words to be retrieved, in this case, adverbs
		// the return value is an array containing all the relevant words
		String[] adverbs = fileIO.getWordCategory(word, "adverb");

		// simply compare each value in the array with the input word
		for (int i = 0; i < adverbs.length; i++) {
			if (adverbs[i].equalsIgnoreCase(word))
				// returning true means this is an adverb
				return true;
		}
		return false;
	}

}